#ifndef SETTINGSMGR_H
#define SETTINGSMGR_H

#include <QSettings>

struct SettingParam
{
    QString paramName;
    QString paramValue;
};

typedef QVector<SettingParam> SettingParamList;


class SettingsMgr
{
public:
    SettingsMgr();
    ~SettingsMgr();

private:
    void writeTest();
    void writeTest2();
    
public:
    QString readString(QString strSection, QString strKey, QString strDefault);
    int readInteger(QString strSection, QString strKey, int iDefault);
    bool readBool(QString strSection, QString strKey, bool bDefault);
    double readDouble(QString strSection, QString strKey, double dDefault);
//    void readArray(QString strSection, QString strKey, SettingParamList params);
    SettingParamList readArray(QString strSection, QString strKey);

    void writeString(QString strSection, QString strKey, QString strValue, QString strDescribe="NoDescribe");
    void writeInteger(QString strSection, QString strKey, int  iValue, QString strDescribe="NoDescribe");
    void writeBool(QString strSection, QString strKey, bool bValue, QString strDescribe="NoDescribe");
    void writeDouble(QString strSection, QString strKey, double dValue, QString strDescribe="NoDescribe");
    void writeArray(QString strSection, QString strKey, SettingParamList params, QString strDescribe="NoDescribe");

private:
    QSettings *ini;
};

#endif // SETTINGSMGR_H
